package com.example.lecturereservation.mapper;

import com.example.lecturereservation.entity.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UsersMapper  extends BaseMapper<Users>{

    @Select("select  * from users where id=#{id}")
    public Users getById(int id);

    @Insert("insert into users values (null,#{email},#{password},#{nickname},#{age},#{gender},#{telephone},#{address})")
    public void save(Users t);

    @Select("select * from users where email=#{email}")
    public Users findByEmail(String email);

    public void deleteById(int id);

    public void update(Users t);

    public List<Users> getAll();

    public List<Users> getPage(int start,int end);
}
